package com.api.gbhg.lbj.action;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.conn.RecordSet;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

/**
 * @author lbj
 * @version 1.0
 * @description: TODO 删除当前流程版本主表数据
 * @date 2021/6/10 10:28
 */
public class DeleteVersiontableAction implements Action {
    private static final Logger logger = LoggerFactory.getLogger("gbhg");
    @Override
    public String execute(RequestInfo requestInfo) {
        logger.info("-进入删除当前流程版本主表数据DeleteVersiontableAction方法——");
        String requestid = requestInfo.getRequestid();
        RecordSet rs=new RecordSet();
        try {
            String sql1="delete from uf_jingfei_version where requestId="+requestid;
            String sql2 = "delete from uf_jingfei where lcjlid="+requestid;
            String sql3 = "delete from uf_jingfeilaiyuan where lcid="+requestid;
            logger.info("删除当前流程版本主表数据sql:"+sql1);
            rs.executeUpdate(sql1);
            rs.executeUpdate(sql2);
            rs.executeUpdate(sql3);
            rs.execute("delete from uf_ysbzyxeshpsj where lcid="+requestid);
            rs.execute("delete from uf_ysbzyxeshpsj_dt1 where mainid="+requestid);
            rs.execute("delete from uf_ysbzyxeshpsj_dt2 where mainid="+requestid);
        }catch (Exception e) {
            e.printStackTrace();
        }
        return Action.SUCCESS;
    }
}
